package com.gxnualbert.mybatisplusDemo.controller;

import com.gxnualbert.mybatisplusDemo.entity.User;
import com.gxnualbert.mybatisplusDemo.service.Person;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther gxnualbert
 * @create 2021-05-17-23:09
 */

@RestController
@RequestMapping("/helloworld")
public class Hello {

    @Autowired
    private Person person;


    @PostMapping("/addPerson")
    public int  hello(@RequestBody User user){

        int result = person.add(user.getName(), user.getAge());
        return result;
    }

}
